package cm.dpassyann.speedDating.controller.inject;

import cm.dpassyann.speedDating.model.dao.user.IUserDao;
import cm.dpassyann.speedDating.model.dao.user.mock.UserDaoMock;
import cm.dpassyann.speedDating.ui.activity.connection.IConnectionActivity;
import cm.dpassyann.speedDating.ui.activity.connection.activity.ConnectionActivity;
import cm.dpassyann.speedDating.ui.activity.start.IStartActivity;
import cm.dpassyann.speedDating.ui.activity.start.activity.StartActivity;
import cm.dpassyann.speedDating.ui.activity.update.IUpdateApplicationActivity;
import cm.dpassyann.speedDating.ui.activity.update.activity.UpdateApplicationActivity;
import cm.dpassyann.speedDating.util.SpeedatingUtil;

import com.google.inject.AbstractModule;


public class SpeedDatingApplication extends AbstractModule{

	@Override
	protected void configure() {
		
		bindActivity();
		
		bindDAO();
		
		bindUtil();
	}

	/**
	 * Méthode permettant de binder les activités
	 */
	private void bindActivity() {
		bind(IUpdateApplicationActivity.class).to(UpdateApplicationActivity.class);

		bind(IStartActivity.class).to(StartActivity.class);
		
		bind(IConnectionActivity.class).to(ConnectionActivity.class);
	}

	/**
	 * Méthode permettant de binder les DAO en RE7
	 */
	private void bindDAO() {
		bind(IUserDao.class).to(UserDaoMock.class);
	}
	
	/**
	 * Méthode permettant de binder les DAO En Prod
	 */
	/*
	private void bindDAO() {
		bind(IUserDao.class).to(UserDaoImpl.class);
	}
	//*/

	/**
	 * Méthode permettant de binder les classes statiques utilitaires
	 */
	private void bindUtil() {
		requestStaticInjection(SpeedatingUtil.class);
		
		//bindConstant().annotatedWith(Names.named("port")).to(8080);
	}
	
}
